3.1.3 \(\int (c+d x) (a+a \sec (e+f x)) \, dx\) [3]

3.1.3.1 Optimal result
3.1.3.2 Mathematica [A] (verified)
3.1.3.3 Rubi [A] (verified)
3.1.3.4 Maple [A] (verified)
3.1.3.5 Fricas [B] (verification not implemented)
3.1.3.6 Sympy [F]
3.1.3.7 Maxima [F]
3.1.3.8 Giac [F]
3.1.3.9 Mupad [F(-1)]

3.1.3.1 Optimal result

Integrand size = 16, antiderivative size = 93 \[ \int (c+d x) (a+a \sec (e+f x)) \, dx=\frac {a (c+d x)^2}{2 d}-\frac {2 i a (c+d x) \arctan \left (e^{i (e+f x)}\right )}{f}+\frac {i a d \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2}-\frac {i a d \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2} \]

output
1/2*a*(d*x+c)^2/d-2*I*a*(d*x+c)*arctan(exp(I*(f*x+e)))/f+I*a*d*polylog(2,- 
I*exp(I*(f*x+e)))/f^2-I*a*d*polylog(2,I*exp(I*(f*x+e)))/f^2
 
3.1.3.2 Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.94 \[ \int (c+d x) (a+a \sec (e+f x)) \, dx=\frac {a \left (f \left (f x (2 c+d x)-4 i (c+d x) \arctan \left (e^{i (e+f x)}\right )\right )+2 i d \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )-2 i d \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )\right )}{2 f^2} \]

input
Integrate[(c + d*x)*(a + a*Sec[e + f*x]),x]
 
output
(a*(f*(f*x*(2*c + d*x) - (4*I)*(c + d*x)*ArcTan[E^(I*(e + f*x))]) + (2*I)* 
d*PolyLog[2, (-I)*E^(I*(e + f*x))] - (2*I)*d*PolyLog[2, I*E^(I*(e + f*x))] 
))/(2*f^2)
 
3.1.3.3 Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {3042, 4678, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (c+d x) (a \sec (e+f x)+a) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (c+d x) \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )dx\)

\(\Big \downarrow \) 4678

\(\displaystyle \int (a (c+d x) \sec (e+f x)+a (c+d x))dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {2 i a (c+d x) \arctan \left (e^{i (e+f x)}\right )}{f}+\frac {a (c+d x)^2}{2 d}+\frac {i a d \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2}-\frac {i a d \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2}\)

input
Int[(c + d*x)*(a + a*Sec[e + f*x]),x]
 
output
(a*(c + d*x)^2)/(2*d) - ((2*I)*a*(c + d*x)*ArcTan[E^(I*(e + f*x))])/f + (I 
*a*d*PolyLog[2, (-I)*E^(I*(e + f*x))])/f^2 - (I*a*d*PolyLog[2, I*E^(I*(e + 
 f*x))])/f^2
 

3.1.3.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4678
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
 
3.1.3.4 Maple [A] (verified)

Time = 0.39 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.53

method result size
parts \(a \left (\frac {1}{2} d \,x^{2}+x c \right )+\frac {a \left (\frac {d \left (-\left (f x +e \right ) \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )+\left (f x +e \right ) \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )+i \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )-i \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )\right )}{f}+c \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )-\frac {e d \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}\right )}{f}\) \(142\)
derivativedivides \(\frac {a c \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )-\frac {a d e \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {a d \left (-\left (f x +e \right ) \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )+\left (f x +e \right ) \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )+i \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )-i \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )\right )}{f}+a c \left (f x +e \right )-\frac {a d e \left (f x +e \right )}{f}+\frac {a d \left (f x +e \right )^{2}}{2 f}}{f}\) \(166\)
default \(\frac {a c \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )-\frac {a d e \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {a d \left (-\left (f x +e \right ) \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )+\left (f x +e \right ) \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )+i \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )-i \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )\right )}{f}+a c \left (f x +e \right )-\frac {a d e \left (f x +e \right )}{f}+\frac {a d \left (f x +e \right )^{2}}{2 f}}{f}\) \(166\)
risch \(\frac {a d \,x^{2}}{2}+a x c -\frac {2 i a c \arctan \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f}-\frac {a d \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right ) x}{f}-\frac {a d \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right ) e}{f^{2}}+\frac {a d \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right ) x}{f}+\frac {a d \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right ) e}{f^{2}}+\frac {i a d \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}-\frac {i a d \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}+\frac {2 i a d e \arctan \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}\) \(186\)

input
int((d*x+c)*(a+a*sec(f*x+e)),x,method=_RETURNVERBOSE)
 
output
a*(1/2*d*x^2+x*c)+a/f*(1/f*d*(-(f*x+e)*ln(1+I*exp(I*(f*x+e)))+(f*x+e)*ln(1 
-I*exp(I*(f*x+e)))+I*dilog(1+I*exp(I*(f*x+e)))-I*dilog(1-I*exp(I*(f*x+e))) 
)+c*ln(sec(f*x+e)+tan(f*x+e))-e/f*d*ln(sec(f*x+e)+tan(f*x+e)))
 
3.1.3.5 Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 343 vs. \(2 (73) = 146\).

Time = 0.33 (sec) , antiderivative size = 343, normalized size of antiderivative = 3.69 \[ \int (c+d x) (a+a \sec (e+f x)) \, dx=\frac {a d f^{2} x^{2} + 2 \, a c f^{2} x - i \, a d {\rm Li}_2\left (i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right )\right ) - i \, a d {\rm Li}_2\left (i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right ) + i \, a d {\rm Li}_2\left (-i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right )\right ) + i \, a d {\rm Li}_2\left (-i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right ) - {\left (a d e - a c f\right )} \log \left (\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right ) + i\right ) + {\left (a d e - a c f\right )} \log \left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right ) + i\right ) + {\left (a d f x + a d e\right )} \log \left (i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right ) + 1\right ) - {\left (a d f x + a d e\right )} \log \left (i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right ) + {\left (a d f x + a d e\right )} \log \left (-i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right ) + 1\right ) - {\left (a d f x + a d e\right )} \log \left (-i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right ) - {\left (a d e - a c f\right )} \log \left (-\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right ) + i\right ) + {\left (a d e - a c f\right )} \log \left (-\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right ) + i\right )}{2 \, f^{2}} \]

input
integrate((d*x+c)*(a+a*sec(f*x+e)),x, algorithm="fricas")
 
output
1/2*(a*d*f^2*x^2 + 2*a*c*f^2*x - I*a*d*dilog(I*cos(f*x + e) + sin(f*x + e) 
) - I*a*d*dilog(I*cos(f*x + e) - sin(f*x + e)) + I*a*d*dilog(-I*cos(f*x + 
e) + sin(f*x + e)) + I*a*d*dilog(-I*cos(f*x + e) - sin(f*x + e)) - (a*d*e 
- a*c*f)*log(cos(f*x + e) + I*sin(f*x + e) + I) + (a*d*e - a*c*f)*log(cos( 
f*x + e) - I*sin(f*x + e) + I) + (a*d*f*x + a*d*e)*log(I*cos(f*x + e) + si 
n(f*x + e) + 1) - (a*d*f*x + a*d*e)*log(I*cos(f*x + e) - sin(f*x + e) + 1) 
 + (a*d*f*x + a*d*e)*log(-I*cos(f*x + e) + sin(f*x + e) + 1) - (a*d*f*x + 
a*d*e)*log(-I*cos(f*x + e) - sin(f*x + e) + 1) - (a*d*e - a*c*f)*log(-cos( 
f*x + e) + I*sin(f*x + e) + I) + (a*d*e - a*c*f)*log(-cos(f*x + e) - I*sin 
(f*x + e) + I))/f^2
 
3.1.3.6 Sympy [F]

\[ \int (c+d x) (a+a \sec (e+f x)) \, dx=a \left (\int c\, dx + \int c \sec {\left (e + f x \right )}\, dx + \int d x\, dx + \int d x \sec {\left (e + f x \right )}\, dx\right ) \]

input
integrate((d*x+c)*(a+a*sec(f*x+e)),x)
 
output
a*(Integral(c, x) + Integral(c*sec(e + f*x), x) + Integral(d*x, x) + Integ 
ral(d*x*sec(e + f*x), x))
 
3.1.3.7 Maxima [F]

\[ \int (c+d x) (a+a \sec (e+f x)) \, dx=\int { {\left (d x + c\right )} {\left (a \sec \left (f x + e\right ) + a\right )} \,d x } \]

input
integrate((d*x+c)*(a+a*sec(f*x+e)),x, algorithm="maxima")
 
output
1/2*(a*d*f*x^2 + 2*a*c*f*x + 4*a*d*f*integrate((x*cos(2*f*x + 2*e)*cos(f*x 
 + e) + x*sin(2*f*x + 2*e)*sin(f*x + e) + x*cos(f*x + e))/(cos(2*f*x + 2*e 
)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1), x) + a*c*log(cos(f*x + 
 e)^2 + sin(f*x + e)^2 + 2*sin(f*x + e) + 1) - a*c*log(cos(f*x + e)^2 + si 
n(f*x + e)^2 - 2*sin(f*x + e) + 1))/f
 
3.1.3.8 Giac [F]

\[ \int (c+d x) (a+a \sec (e+f x)) \, dx=\int { {\left (d x + c\right )} {\left (a \sec \left (f x + e\right ) + a\right )} \,d x } \]

input
integrate((d*x+c)*(a+a*sec(f*x+e)),x, algorithm="giac")
 
output
integrate((d*x + c)*(a*sec(f*x + e) + a), x)
 
3.1.3.9 Mupad [F(-1)]

Timed out. \[ \int (c+d x) (a+a \sec (e+f x)) \, dx=\int \left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )\,\left (c+d\,x\right ) \,d x \]

input
int((a + a/cos(e + f*x))*(c + d*x),x)
 
output
int((a + a/cos(e + f*x))*(c + d*x), x)